package com.jxaummd.aquaculture.ui.fragment.third;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jxaummd.aquaculture.R;
import com.jxaummd.aquaculture.base.BaseMainFragment;

public class ThirdTabFragment extends BaseMainFragment {

    private Item itemBinding ;
    private Item itemSetting ;
    private Item itemProdect ;
    private Item itemAboutOur ;



    public static ThirdTabFragment newInstance() {
        Bundle args = new Bundle();
        ThirdTabFragment fragment = new ThirdTabFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.frgment_third, container, false);
        initView(view);
        return view;
    }
    private void initView(View view) {
        itemBinding = new Item(R.id.item_third_function_1_binding, view, "设备数量", "已绑定1台", new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        itemSetting = new Item(R.id.item_third_function_2_binding, view, "系统设置", "", new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        itemProdect = new Item(R.id.item_third_function_3_binding, view, "更多产品", "", new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        itemAboutOur = new Item(R.id.item_third_function_4_binding, view, "关于我们", "", new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
    }

    class Item{
        int id;
        View view ;
        TextView mtitle;
        TextView mcontent;
        public Item(int id,View parentView, String title , String content, View.OnClickListener listener) {
            view = parentView.findViewById(id);
            view.setOnClickListener(listener);
            mtitle = view.findViewById(R.id.item_third_function_title);
            mcontent = view.findViewById(R.id.item_third_function_content);
            mtitle.setText(title);
            mcontent.setText(content);
        }


    }

}



